package euclid;

/**
 * Interface definition: gcdProcess.
 * 
 * @author OpenORB Compiler
 */
public abstract class gcdProcessPOA extends org.omg.PortableServer.Servant
        implements gcdProcessOperations, org.omg.CORBA.portable.InvokeHandler
{
    public gcdProcess _this()
    {
        return gcdProcessHelper.narrow(_this_object());
    }

    public gcdProcess _this(org.omg.CORBA.ORB orb)
    {
        return gcdProcessHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:euclid/gcdProcess:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("endProcess")) {
                return _invoke_endProcess(_is, handler);
        } else if (opName.equals("getId")) {
                return _invoke_getId(_is, handler);
        } else if (opName.equals("getName")) {
                return _invoke_getName(_is, handler);
        } else if (opName.equals("getProcessId")) {
                return _invoke_getProcessId(_is, handler);
        } else if (opName.equals("giveNewValue")) {
                return _invoke_giveNewValue(_is, handler);
        } else if (opName.equals("init")) {
                return _invoke_init(_is, handler);
        } else if (opName.equals("isFinished")) {
                return _invoke_isFinished(_is, handler);
        } else if (opName.equals("startProcess")) {
                return _invoke_startProcess(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_init(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        int arg1_in = _is.read_long();
        int arg2_in = _is.read_long();
        euclid.gcdProcess arg3_in = euclid.gcdProcessHelper.read(_is);
        euclid.gcdProcess arg4_in = euclid.gcdProcessHelper.read(_is);
        monitor.Monitor arg5_in = euclid.MonitorHelper.read(_is);

        init(arg0_in, arg1_in, arg2_in, arg3_in, arg4_in, arg5_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getId(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        int _arg_result = getId();

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getName(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getName();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getProcessId(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getProcessId();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_giveNewValue(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        giveNewValue(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_startProcess(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        startProcess();

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_isFinished(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        int arg1_in = _is.read_long();

        boolean _arg_result = isFinished(arg0_in, arg1_in);

        _output = handler.createReply();
        _output.write_boolean(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_endProcess(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        endProcess();

        _output = handler.createReply();

        return _output;
    }

}
